Skip to content

Comments

Fix isinstance(Unpack[Ts], TypeVar) to be False in 3.11#539

Merged
JelleZijlstra merged 4 commits intopython:mainfrom
Daraan:3.11/Unpack__class__
Mar 12, 2025
Merged

Fix isinstance(Unpack[Ts], TypeVar) to be False in 3.11#539
JelleZijlstra merged 4 commits intopython:mainfrom
Daraan:3.11/Unpack__class__

Conversation

@Daraan
Copy link
Contributor

@Daraan Daraan commented Mar 12, 2025

In relation to #538 a minor fix for 3.11 only. For <3.11 it's currently a necessary trick to keep the __class__ = typing.TypeVar attribute allow using Generic[Unpack[Ts]].

I am not sure if the additional test is that important, I slightly in favor of removing it again.

@Daraan Daraan changed the title Fix 3.11 isinstance(Unpack[Ts], TypeVar) to be False Fix isinstance(Unpack[Ts], TypeVar) to be False in 3.11 Mar 12, 2025
@JelleZijlstra JelleZijlstra merged commit 7def253 into python:main Mar 12, 2025
23 checks passed
@Daraan Daraan deleted the 3.11/Unpack__class__ branch March 13, 2025 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants